package com.dcy.znoa.common.enums;

/**
 * Created by pengyu on 2017/10/6.
 */
public enum ApplyTypeCode {
    //申请类型 1 请假 2 出差 3 外勤 9 申述
    Apply1(1, "请假"),
    Apply2(2, "出差"),
    Apply3(3, "外勤"),
    Apply9(9, "申述");

    private Integer code;
    private String msg;

    private ApplyTypeCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static  String getMsgByCode(Integer code) {
        if(code==null){return null;}
        switch (code.intValue()) {
            case 1:
                return Apply1.getMsg();
            case 2:
                return Apply2.getMsg();
            case 3:
                return Apply3.getMsg();
            case 9:
                return Apply9.getMsg();
            default:
                return null;
        }
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static  void main(String args[]){
        System.out.println(getMsgByCode(2));

    }

}

